home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / vm / vm-toolbar.el.z / vm-toolbar.el
Encoding:
Text File  |  1998-05-21  |  17.8 KB  |  475 lines

  1. ;;; Toolbar related functions and commands
  2. ;;; Copyright (C) 1995-1997 Kyle E. Jones
  3. ;;;
  4. ;;; This program is free software; you can redistribute it and/or modify
  5. ;;; it under the terms of the GNU General Public License as published by
  6. ;;; the Free Software Foundation; either version 1, or (at your option)
  7. ;;; any later version.
  8. ;;;
  9. ;;; This program is distributed in the hope that it will be useful,
  10. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. ;;; GNU General Public License for more details.
  13. ;;;
  14. ;;; You should have received a copy of the GNU General Public License
  15. ;;; along with this program; if not, write to the Free Software
  16. ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. (provide 'vm-toolbar)
  19.  
  20. (defvar vm-toolbar-specifier nil)
  21.  
  22. (defvar vm-toolbar-next-button
  23.   [vm-toolbar-next-icon
  24.    vm-toolbar-next-command
  25.    (vm-toolbar-any-messages-p)
  26.    "Go to the next message.\n
  27. The command `vm-toolbar-next-command' is run, which is normally
  28. fbound to `vm-next-message'.
  29. You can make this button run some other command by using a Lisp
  30. s-expression like this one in your .vm file:
  31.    (fset 'vm-toolbar-next-command 'some-other-command)"])
  32. (defvar vm-toolbar-next-icon nil)
  33. (or (fboundp 'vm-toolbar-next-command)
  34.     (fset 'vm-toolbar-next-command 'vm-next-message))
  35.  
  36. (defvar vm-toolbar-previous-button
  37.   [vm-toolbar-previous-icon
  38.    vm-toolbar-previous-command
  39.    (vm-toolbar-any-messages-p)
  40.    "Go to the previous message.\n
  41. The command `vm-toolbar-previous-command' is run, which is normally
  42. fbound to `vm-previous-message'.
  43. You can make this button run some other command by using a Lisp
  44. s-expression like this one in your .vm file:
  45.    (fset 'vm-toolbar-previous-command 'some-other-command)"])
  46. (defvar vm-toolbar-previous-icon nil)
  47. (or (fboundp 'vm-toolbar-previous-command)
  48.     (fset 'vm-toolbar-previous-command 'vm-previous-message))
  49.  
  50. (defvar vm-toolbar-autofile-button
  51.   [vm-toolbar-autofile-icon
  52.    vm-toolbar-autofile-message
  53.    (vm-toolbar-can-autofile-p)
  54.   "Save the current message to a folder selected using vm-auto-folder-alist."])
  55. (defvar vm-toolbar-autofile-icon nil)
  56.  
  57. (defvar vm-toolbar-file-button
  58.   [vm-toolbar-file-icon vm-toolbar-file-command (vm-toolbar-any-messages-p)
  59.    "Save the current message to a folder.\n
  60. The command `vm-toolbar-file-command' is run, which is normally
  61. fbound to `vm-save-message'.
  62. You can make this button run some other command by using a Lisp
  63. s-expression like this one in your .vm file:
  64.    (fset 'vm-toolbar-file-command 'some-other-command)"])
  65. (defvar vm-toolbar-file-icon nil)
  66. (or (fboundp 'vm-toolbar-file-command)
  67.     (fset 'vm-toolbar-file-command 'vm-save-message))
  68.  
  69. (defvar vm-toolbar-getmail-button
  70.   [vm-toolbar-getmail-icon vm-toolbar-getmail-command
  71.    (vm-toolbar-mail-waiting-p)
  72.    "Retrieve spooled mail for the current folder.\n
  73. The command `vm-toolbar-getmail-command' is run, which is normally
  74. fbound to `vm-get-new-mail'.
  75. You can make this button run some other command by using a Lisp
  76. s-expression like this one in your .vm file:
  77.    (fset 'vm-toolbar-getmail-command 'some-other-command)"])
  78. (defvar vm-toolbar-getmail-icon nil)
  79. (or (fboundp 'vm-toolbar-getmail-command)
  80.     (fset 'vm-toolbar-getmail-command 'vm-get-new-mail))
  81.  
  82. (defvar vm-toolbar-print-button
  83.   [vm-toolbar-print-icon
  84.    vm-toolbar-print-command
  85.    (vm-toolbar-any-messages-p)
  86.    "Print the current message.\n
  87. The command `vm-toolbar-print-command' is run, which is normally
  88. fbound to `vm-print-message'.
  89. You can make this button run some other command by using a Lisp
  90. s-expression like this one in your .vm file:
  91.    (fset 'vm-toolbar-print-command 'some-other-command)"])
  92. (defvar vm-toolbar-print-icon nil)
  93. (or (fboundp 'vm-toolbar-print-command)
  94.     (fset 'vm-toolbar-print-command 'vm-print-message))
  95.  
  96. (defvar vm-toolbar-visit-button
  97.   [vm-toolbar-visit-icon vm-toolbar-visit-command t
  98.    "Visit a different folder.\n
  99. The command `vm-toolbar-visit-command' is run, which is normally
  100. fbound to `vm-visit-folder'.
  101. You can make this button run some other command by using a Lisp
  102. s-expression like this one in your .vm file:
  103.    (fset 'vm-toolbar-visit-command 'some-other-command)"])
  104. (defvar vm-toolbar-visit-icon nil)
  105. (or (fboundp 'vm-toolbar-visit-command)
  106.     (fset 'vm-toolbar-visit-command 'vm-visit-folder))
  107.  
  108. (defvar vm-toolbar-reply-button
  109.   [vm-toolbar-reply-icon
  110.    vm-toolbar-reply-command
  111.    (vm-toolbar-any-messages-p)
  112.    "Reply to the current message.\n
  113. The command `vm-toolbar-reply-command' is run, which is normally
  114. fbound to `vm-followup-include-text'.
  115. You can make this button run some other command by using a Lisp
  116. s-expression like this one in your .vm file:
  117.    (fset 'vm-toolbar-reply-command 'some-other-command)"])
  118. (defvar vm-toolbar-reply-icon nil)
  119. (or (fboundp 'vm-toolbar-reply-command)
  120.     (fset 'vm-toolbar-reply-command 'vm-followup-include-text))
  121.  
  122. (defvar vm-toolbar-compose-button
  123.   [vm-toolbar-compose-icon vm-toolbar-compose-command t
  124.    "Compose a new message.\n
  125. The command `vm-toolbar-compose-command' is run, which is normally
  126. fbound to `vm-mail'.
  127. You can make this button run some other command by using a Lisp
  128. s-expression like this one in your .vm file:
  129.    (fset 'vm-toolbar-compose-command 'some-other-command)"])
  130. (defvar vm-toolbar-compose-icon nil)
  131. (or (fboundp 'vm-toolbar-compose-command)
  132.     (fset 'vm-toolbar-compose-command 'vm-mail))
  133.  
  134. (defvar vm-toolbar-decode-mime-button
  135.   [vm-toolbar-decode-mime-icon vm-toolbar-decode-mime-command
  136.    (vm-toolbar-can-decode-mime-p)
  137.    "Decode the MIME objects in the current message.\n
  138. The objects might be displayed immediately, or buttons might be
  139. displayed that you need to click on to view the object.  See the
  140. documentation for the variables vm-mime-internal-content-types
  141. and vm-mime-external-content-types-alist to see how to control
  142. whether you see buttons or objects.\n
  143. The command `vm-toolbar-decode-mime-command' is run, which is normally
  144. fbound to `vm-decode-mime-messages'.
  145. You can make this button run some other command by using a Lisp
  146. s-expression like this one in your .vm file:
  147.    (fset 'vm-toolbar-decode-mime-command 'some-other-command)"])
  148. (defvar vm-toolbar-decode-mime-icon nil)
  149. (or (fboundp 'vm-toolbar-decode-mime-command)
  150.     (fset 'vm-toolbar-decode-mime-command 'vm-decode-mime-message))
  151.  
  152. (defvar vm-toolbar-delete-icon nil)
  153.  
  154. (defvar vm-toolbar-undelete-icon nil)
  155.  
  156. (defvar vm-toolbar-delete/undelete-button
  157.   [vm-toolbar-delete/undelete-icon
  158.    vm-toolbar-delete/undelete-message
  159.    (vm-toolbar-any-messages-p)
  160.    "Delete the current message, or undelete it if it is already deleted."])
  161. (defvar vm-toolbar-delete/undelete-icon nil)
  162. (make-variable-buffer-local 'vm-toolbar-delete/undelete-icon)
  163.  
  164. (defvar vm-toolbar-help-icon nil)
  165.  
  166. (defvar vm-toolbar-recover-icon nil)
  167.  
  168. (defvar vm-toolbar-helper-icon nil)
  169. (make-variable-buffer-local 'vm-toolbar-helper-icon)
  170.  
  171. (defvar vm-toolbar-help-button
  172.   [vm-toolbar-helper-icon vm-toolbar-helper-command
  173.    (vm-toolbar-can-help-p)
  174.    "Don't Panic.\n
  175. VM uses this button to offer help if you're in trouble.
  176. Under normal circumstances, this button runs `vm-help'.\n
  177. If the current folder looks out-of-date relative to its auto-save
  178. file then this button will run `recover-file'."])
  179.  
  180. (defvar vm-toolbar-helper-command nil)
  181. (make-variable-buffer-local 'vm-toolbar-helper-command)
  182.  
  183. (defun vm-toolbar-helper-command ()
  184.   (interactive)
  185.   (setq this-command vm-toolbar-helper-command)
  186.   (call-interactively vm-toolbar-helper-command))
  187.  
  188. (defvar vm-toolbar-quit-button
  189.   [vm-toolbar-quit-icon vm-toolbar-quit-command
  190.    (vm-toolbar-can-quit-p)
  191.    "Quit visiting this folder.\n
  192. The command `vm-toolbar-quit-command' is run, which is normally
  193. fbound to `vm-quit'.
  194. You can make this button run some other command by using a Lisp
  195. s-expression like this one in your .vm file:
  196.    (fset 'vm-toolbar-quit-command 'some-other-command)"])
  197. (defvar vm-toolbar-quit-icon nil)
  198. (or (fboundp 'vm-toolbar-quit-command)
  199.     (fset 'vm-toolbar-quit-command 'vm-quit))
  200.  
  201. (defun vm-toolbar-any-messages-p ()
  202.   (condition-case nil
  203.       (save-excursion
  204.     (vm-check-for-killed-folder)
  205.     (vm-select-folder-buffer)
  206.     vm-message-list)
  207.     (error nil)))
  208.  
  209. (defun vm-toolbar-delete/undelete-message (&optional prefix-arg)
  210.   (interactive "P")
  211.   (vm-follow-summary-cursor)
  212.   (vm-select-folder-buffer)
  213.   (vm-check-for-killed-summary)
  214.   (vm-error-if-folder-read-only)
  215.   (vm-error-if-folder-empty)
  216.   (let ((current-prefix-arg prefix-arg))
  217.     (if (vm-deleted-flag (car vm-message-pointer))
  218.     (call-interactively 'vm-undelete-message)
  219.       (call-interactively 'vm-delete-message))))
  220.  
  221. (defun vm-toolbar-can-autofile-p ()
  222.   (interactive)
  223.   (condition-case nil
  224.       (save-excursion
  225.     (vm-check-for-killed-folder)
  226.     (vm-select-folder-buffer)
  227.     (and vm-message-pointer
  228.          (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
  229.     (error nil)))
  230.  
  231. (defun vm-toolbar-autofile-message ()
  232.   (interactive)
  233.   (vm-follow-summary-cursor)
  234.   (vm-select-folder-buffer)
  235.   (vm-check-for-killed-summary)
  236.   (vm-error-if-folder-read-only)
  237.   (vm-error-if-folder-empty)
  238.   (let ((file (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
  239.     (if file
  240.     (progn
  241.       (vm-save-message file 1)
  242.       (message "Message saved to %s" file))
  243.       (error "No match for message in vm-auto-folder-alist."))))
  244.  
  245. (defun vm-toolbar-can-recover-p ()
  246.   (condition-case nil
  247.       (save-excursion
  248.     (vm-select-folder-buffer)
  249.     (and vm-folder-read-only
  250.          buffer-file-name
  251.          buffer-auto-save-file-name
  252.          (null (buffer-modified-p))
  253.          (file-newer-than-file-p
  254.           buffer-auto-save-file-name
  255.           buffer-file-name)))
  256.     (error nil)))
  257.  
  258. (defun vm-toolbar-can-decode-mime-p ()
  259.   (condition-case nil
  260.       (save-excursion
  261.     (vm-select-folder-buffer)
  262.     (and
  263.      vm-display-using-mime
  264.      vm-message-pointer
  265.      vm-presentation-buffer
  266.      (not (vm-mime-plain-message-p (car vm-message-pointer)))))
  267.     (error nil)))
  268.  
  269. (defun vm-toolbar-can-quit-p ()
  270.   (condition-case nil
  271.       (save-excursion
  272.     (vm-select-folder-buffer)
  273.     (memq major-mode '(vm-mode vm-virtual-mode)))
  274.     (error nil)))
  275.  
  276. (defun vm-toolbar-mail-waiting-p ()
  277.   (condition-case nil
  278.       (save-excursion
  279.     (vm-select-folder-buffer)
  280.     vm-spooled-mail-waiting)
  281.     (error nil)))
  282.  
  283. (fset 'vm-toolbar-can-help-p 'vm-toolbar-can-quit-p)
  284.  
  285. (defun vm-toolbar-update-toolbar ()
  286.   (if (and vm-message-pointer (vm-deleted-flag (car vm-message-pointer)))
  287.       (setq vm-toolbar-delete/undelete-icon vm-toolbar-undelete-icon)
  288.     (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon))
  289.   (cond ((vm-toolbar-can-recover-p)
  290.      (setq vm-toolbar-helper-command 'recover-file
  291.            vm-toolbar-helper-icon vm-toolbar-recover-icon))
  292.     ((vm-toolbar-mail-waiting-p)
  293.      (setq vm-toolbar-helper-command 'vm-get-new-mail
  294.            vm-toolbar-helper-icon vm-toolbar-getmail-icon))
  295.     ((and (vm-toolbar-can-decode-mime-p) (not vm-mime-decoded))
  296.      (setq vm-toolbar-helper-command 'vm-decode-mime-message
  297.            vm-toolbar-helper-icon vm-toolbar-decode-mime-icon))
  298.     (t
  299.      (setq vm-toolbar-helper-command 'vm-help
  300.            vm-toolbar-helper-icon vm-toolbar-help-icon)))
  301.   (if vm-summary-buffer
  302.       (vm-copy-local-variables vm-summary-buffer
  303.                    'vm-toolbar-delete/undelete-icon
  304.                    'vm-toolbar-helper-command
  305.                    'vm-toolbar-helper-icon))
  306.   (if vm-presentation-buffer
  307.       (vm-copy-local-variables vm-presentation-buffer
  308.                    'vm-toolbar-delete/undelete-icon
  309.                    'vm-toolbar-helper-command
  310.                    'vm-toolbar-helper-icon))
  311.   (and vm-toolbar-specifier
  312.        (progn
  313.      (set-specifier vm-toolbar-specifier (cons (current-buffer) nil))
  314.      (set-specifier vm-toolbar-specifier (cons (current-buffer)
  315.                            vm-toolbar)))))
  316.  
  317. (defun vm-toolbar-install-toolbar ()
  318.   (vm-toolbar-initialize)
  319.   (let ((height (+ 4 (glyph-height (car vm-toolbar-help-icon))))
  320.     (width (+ 4 (glyph-width (car vm-toolbar-help-icon))))
  321.     (frame (selected-frame))
  322.     (buffer (current-buffer))
  323.     (tag-set '(win))
  324.     (myframe (vm-created-this-frame-p))
  325.     toolbar )
  326.     ;; glyph-width and glyph-height return 0 at startup sometimes
  327.     ;; use reasonable values if they fail.
  328.     (if (= width 4)
  329.     (setq width 68))
  330.     (if (= height 4)
  331.     (setq height 46))
  332.     ;; honor user setting of vm-toolbar if they are daring enough
  333.     ;; to set it.
  334.     (if vm-toolbar
  335.     (setq toolbar vm-toolbar)
  336.       (setq toolbar (vm-toolbar-make-toolbar-spec)
  337.         vm-toolbar toolbar))
  338.     (cond ((eq vm-toolbar-orientation 'right)
  339.        (setq vm-toolbar-specifier right-toolbar)
  340.        (if myframe
  341.            (set-specifier right-toolbar toolbar frame tag-set))
  342.        (set-specifier right-toolbar toolbar buffer)
  343.        (set-specifier right-toolbar-width width frame tag-set))
  344.       ((eq vm-toolbar-orientation 'left)
  345.        (setq vm-toolbar-specifier left-toolbar)
  346.        (if myframe
  347.            (set-specifier left-toolbar toolbar frame tag-set))
  348.        (set-specifier left-toolbar toolbar buffer)
  349.        (set-specifier left-toolbar-width width frame tag-set))
  350.       ((eq vm-toolbar-orientation 'bottom)
  351.        (setq vm-toolbar-specifier bottom-toolbar)
  352.        (if myframe
  353.            (set-specifier bottom-toolbar toolbar frame tag-set))
  354.        (set-specifier bottom-toolbar toolbar buffer)
  355.        (set-specifier bottom-toolbar-height height frame tag-set))
  356.       (t
  357.        (setq vm-toolbar-specifier top-toolbar)
  358.        (if myframe
  359.            (set-specifier top-toolbar toolbar frame tag-set))
  360.        (set-specifier top-toolbar toolbar buffer)
  361.        (set-specifier top-toolbar-height height frame tag-set)))))
  362.  
  363. (defun vm-toolbar-make-toolbar-spec ()
  364.   (let ((button-alist '(
  365.             (autofile . vm-toolbar-autofile-button)
  366.             (compose . vm-toolbar-compose-button)
  367.             (delete/undelete . vm-toolbar-delete/undelete-button)
  368.             (file . vm-toolbar-file-button)
  369.             (getmail . vm-toolbar-getmail-button)
  370.             (help . vm-toolbar-help-button)
  371.             (mime . vm-toolbar-decode-mime-button)
  372.             (next . vm-toolbar-next-button)
  373.             (previous . vm-toolbar-previous-button)
  374.             (print . vm-toolbar-print-button)
  375.             (quit . vm-toolbar-quit-button)
  376.             (reply . vm-toolbar-reply-button)
  377.             (visit . vm-toolbar-visit-button)
  378.             ))
  379.     (button-list vm-use-toolbar)
  380.     cons
  381.     (toolbar nil))
  382.     (while button-list
  383.       (cond ((null (car button-list))
  384.          (setq toolbar (cons nil toolbar)))
  385.         ((integerp (car button-list))
  386.          (if (< 0 (car button-list))
  387.          (setq toolbar (cons (vector ':size (car button-list)
  388.                          ':style '2d)
  389.                      toolbar))))
  390.         (t
  391.          (setq cons (assq (car button-list) button-alist))
  392.          (if cons
  393.          (setq toolbar (cons (symbol-value (cdr cons)) toolbar)))))
  394.       (setq button-list (cdr button-list)))
  395.     (nreverse toolbar) ))
  396.  
  397. (defun vm-toolbar-initialize ()
  398.   ;; drag these in now instead of waiting for them to be
  399.   ;; autoloaded.  the "loading..." messages could come at a bad
  400.   ;; moment and wipe an important echo area message, like "Auto
  401.   ;; save file is newer..."
  402.   (require 'vm-save)
  403.   (require 'vm-summary)
  404.   (cond
  405.    ((null vm-toolbar-help-icon)
  406.     (let ((tuples
  407.        (if (featurep 'xpm)
  408.            (list
  409.         (if (and (device-on-window-system-p)
  410.              (>= (device-bitplanes) 16))
  411.       '(vm-toolbar-decode-mime-icon "mime-colorful-up.xpm"
  412.                     "mime-colorful-dn.xpm"
  413.                     "mime-colorful-xx.xpm")
  414.    '(vm-toolbar-decode-mime-icon "mime-simple-up.xpm"
  415.                  "mime-simple-dn.xpm"
  416.                  "mime-simple-xx.xpm"))
  417.  '(vm-toolbar-next-icon "next-up.xpm" "next-dn.xpm" "next-dn.xpm")
  418.  '(vm-toolbar-previous-icon "previous-up.xpm" "previous-dn.xpm"
  419.                "previous-dn.xpm")
  420.  '(vm-toolbar-delete-icon "delete-up.xpm" "delete-dn.xpm" "delete-dn.xpm")
  421.  '(vm-toolbar-undelete-icon "undelete-up.xpm" "undelete-dn.xpm"
  422.                "undelete-dn.xpm")
  423.  '(vm-toolbar-autofile-icon "autofile-up.xpm" "autofile-dn.xpm"
  424.                "autofile-dn.xpm")
  425.  '(vm-toolbar-getmail-icon "getmail-up.xpm" "getmail-dn.xpm" "getmail-dn.xpm")
  426.  '(vm-toolbar-file-icon "file-up.xpm" "file-dn.xpm" "file-dn.xpm")
  427.  '(vm-toolbar-reply-icon "reply-up.xpm" "reply-dn.xpm" "reply-dn.xpm")
  428.  '(vm-toolbar-compose-icon "compose-up.xpm" "compose-dn.xpm" "compose-dn.xpm")
  429.  '(vm-toolbar-print-icon "print-up.xpm" "print-dn.xpm" "print-dn.xpm")
  430.  '(vm-toolbar-visit-icon "visit-up.xpm" "visit-dn.xpm" "visit-dn.xpm")
  431.  '(vm-toolbar-quit-icon "quit-up.xpm" "quit-dn.xpm" "quit-dn.xpm")
  432.  '(vm-toolbar-help-icon "help-up.xpm" "help-dn.xpm" "help-dn.xpm")
  433.  '(vm-toolbar-recover-icon "recover-up.xpm" "recover-dn.xpm" "recover-dn.xpm")
  434.        )
  435.            '(
  436.  (vm-toolbar-decode-mime-icon "mime-up.xbm" "mime-dn.xbm" "mime-xx.xbm")
  437.  (vm-toolbar-next-icon "next-up.xbm" "next-dn.xbm" "next-xx.xbm")
  438.  (vm-toolbar-previous-icon "previous-up.xbm" "previous-dn.xbm"
  439.                "previous-xx.xbm")
  440.  (vm-toolbar-delete-icon "delete-up.xbm" "delete-dn.xbm" "delete-xx.xbm")
  441.  (vm-toolbar-undelete-icon "undelete-up.xbm" "undelete-dn.xbm"
  442.                "undelete-xx.xbm")
  443.  (vm-toolbar-autofile-icon "autofile-up.xbm" "autofile-dn.xbm"
  444.                "autofile-xx.xbm")
  445.  (vm-toolbar-getmail-icon "getmail-up.xbm" "getmail-dn.xbm" "getmail-xx.xbm")
  446.  (vm-toolbar-file-icon "file-up.xbm" "file-dn.xbm" "file-xx.xbm")
  447.  (vm-toolbar-reply-icon "reply-up.xbm" "reply-dn.xbm" "reply-xx.xbm")
  448.  (vm-toolbar-compose-icon "compose-up.xbm" "compose-dn.xbm" "compose-xx.xbm")
  449.  (vm-toolbar-print-icon "print-up.xbm" "print-dn.xbm" "print-xx.xbm")
  450.  (vm-toolbar-visit-icon "visit-up.xbm" "visit-dn.xbm" "visit-xx.xbm")
  451.  (vm-toolbar-quit-icon "quit-up.xbm" "quit-dn.xbm" "quit-xx.xbm")
  452.  (vm-toolbar-help-icon "help-up.xbm" "help-dn.xbm" "help-xx.xpm")
  453.  (vm-toolbar-recover-icon "recover-up.xbm" "recover-dn.xbm" "recover-xx.xpm")
  454.        )))
  455.       tuple files var)
  456.       (if (not (file-directory-p vm-toolbar-pixmap-directory))
  457.       (error "Bad toolbar pixmap directory: %s"
  458.          vm-toolbar-pixmap-directory)
  459.     (while tuples
  460.       (setq tuple (car tuples)
  461.         var (car tuple)
  462.         files (cdr tuple))
  463.       (set var (mapcar
  464.             (function
  465.              (lambda (f)
  466.                (make-glyph
  467.             (expand-file-name f vm-toolbar-pixmap-directory))))
  468.             files))
  469.       (setq tuples (cdr tuples)))))))
  470.   (setq vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
  471.   (setq-default vm-toolbar-delete/undelete-icon vm-toolbar-delete-icon)
  472.   (setq vm-toolbar-helper-command 'vm-help)
  473.   (setq vm-toolbar-helper-icon vm-toolbar-help-icon)
  474.   (setq-default vm-toolbar-helper-icon vm-toolbar-help-icon))
  475.